package org.ali.creationalpattern.singletonpattern.singletonobject;

/**
 * 懒汉式，懒加载
 */
public class SingletonObject2 {
    private static SingletonObject2 object;

    private SingletonObject2() {
    }

    public static SingletonObject2 getInstance() {
        if (object == null) {
            object = new SingletonObject2();
        }
        return object;
    }

    public void showMessage() {
        System.out.println("懒汉式，懒加载");
    }
}
